//--------------------------------------------------------------------------------------------
//     : 
//      Component name  : fpnormalize
//      Author          : 
//      Company         : 
//
//      Description     : 
//
//
//--------------------------------------------------------------------------------------------


module FPnormalize(SIG_in, EXP_in, SIG_out, EXP_out);
   parameter              SIG_width = 28;
   input [SIG_width-1:0]  SIG_in;
   input [7:0]            EXP_in;
   output [SIG_width-1:0] SIG_out;
   reg [SIG_width-1:0]    SIG_out;
   output [7:0]           EXP_out;
   reg [7:0]              EXP_out;
   
   
   
   always @(SIG_in or EXP_in)
      if (SIG_in[SIG_width - 1] == 1'b1)
      begin
         SIG_out <= {1'b0, SIG_in[SIG_width - 1:2], (SIG_in[1] & SIG_in[0])};
         EXP_out <= EXP_in + 1;
      end
      else
      begin
         SIG_out <= SIG_in;
         EXP_out <= EXP_in;
      end
   
endmodule
